home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Utilities / Random Stuff / Clock / card_2886.txt < prev    next >
Encoding:
Text File  |  1988-04-24  |  5.5 KB  |  256 lines

  1. -- card: 2886 from stack: in
  2. -- bmap block id: 3320
  3. -- flags: 0000
  4. -- background id: 2750
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on opencard
  8.   hide menubar
  9.   put the long date into card field "date"
  10. end opencard
  11.  
  12. on idle
  13.   if the time is not card field "digitaltime" then
  14.     global handpos
  15.     global smhandpos
  16.     global alarmset
  17.     put the time into card field "digitaltime"
  18.     if ((alarmset is 1) and (card field "digitaltime" is card field "settime")) then
  19.       play "boing" "c g f e d b c"
  20.       send mouseup to card button "off"
  21.     end if
  22.     choose select tool
  23.     domenu "select all"
  24.     domenu "clear picture"
  25.     get the seconds
  26.     convert it to dateitems
  27.     put item 5 of it into smhandpos
  28.     put item 4 of it into handpos
  29.     if handpos > 12 then subtract 12 from handpos
  30.     choose line tool
  31.     minutehand
  32.     hourhand
  33.     choose browse tool
  34.   end if
  35. end idle
  36.  
  37. on hourhand
  38.   global smhandpos
  39.   set linesize to 2
  40.   put 2 * pi * smhandpos/60 into angle
  41.   put 261 + round(80 * sin(angle)) into x
  42.   put 169 - round(80 * cos(angle)) into y
  43.   drag from 261,169 to x,y
  44. end hourhand
  45.  
  46. on minutehand
  47.   global handpos
  48.   set linesize to 3
  49.   put 2 * pi * handpos/12 into angle
  50.   put 261 + round(50 * sin(angle)) into x
  51.   put 169 - round(50 * cos(angle)) into y
  52.   drag from 261,169 to x,y
  53. end minutehand
  54.  
  55. on closecard
  56.   show menubar
  57. end closecard
  58.  
  59.  
  60.  
  61. -- part 2 (field)
  62. -- low flags: 00
  63. -- high flags: 0000
  64. -- rect: left=40 top=289 right=306 bottom=108
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 0 / 0
  67. -- text alignment: 1
  68. -- font id: 3
  69. -- text size: 12
  70. -- style flags: 0
  71. -- line height: 16
  72. -- part name: digitaltime
  73.  
  74.  
  75. -- part 3 (field)
  76. -- low flags: 00
  77. -- high flags: 0000
  78. -- rect: left=315 top=260 right=277 bottom=465
  79. -- title width / last selected line: 0
  80. -- icon id / first selected line: 0 / 0
  81. -- text alignment: 1
  82. -- font id: 3
  83. -- text size: 9
  84. -- style flags: 0
  85. -- line height: 12
  86. -- part name: date
  87.  
  88.  
  89. -- part 6 (button)
  90. -- low flags: 00
  91. -- high flags: 2000
  92. -- rect: left=7 top=32 right=56 bottom=31
  93. -- title width / last selected line: 0
  94. -- icon id / first selected line: 0 / 0
  95. -- text alignment: 1
  96. -- font id: 0
  97. -- text size: 12
  98. -- style flags: 0
  99. -- line height: 16
  100. -- part name: New Button
  101. ----- HyperTalk script -----
  102. on mouseUp
  103.   go "home"
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part 8 (button)
  109. -- low flags: 00
  110. -- high flags: C006
  111. -- rect: left=56 top=96 right=110 bottom=102
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Set
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   set hilite of button "on" to false
  123.   set hilite of button "off" to false
  124.   set hilite of button "set" to true
  125.   show card field "settime"
  126.   put empty into card field "settime"
  127.   click at the loc of card field "settime"
  128. end mouseUp
  129.  
  130.  
  131.  
  132. -- part 10 (button)
  133. -- low flags: 00
  134. -- high flags: 8006
  135. -- rect: left=56 top=111 right=125 bottom=98
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 0 / 0
  138. -- text alignment: 1
  139. -- font id: 0
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: On
  144. ----- HyperTalk script -----
  145. on mouseUp
  146.   global alarmset
  147.   set hilite of button "on" to true
  148.   set hilite of button "off" to false
  149.   set hilite of button "set" to false
  150.   show card field "settime"
  151.   if card field "settime" is empty then
  152.     send mouseup to card button "set"
  153.   end if
  154.   send "closefield" to card field "settime"
  155.   put 1 into alarmset
  156. end mouseUp
  157.  
  158.  
  159.  
  160. -- part 11 (button)
  161. -- low flags: 00
  162. -- high flags: 8006
  163. -- rect: left=56 top=126 right=140 bottom=98
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 0 / 0
  166. -- text alignment: 1
  167. -- font id: 0
  168. -- text size: 12
  169. -- style flags: 0
  170. -- line height: 16
  171. -- part name: Off
  172. ----- HyperTalk script -----
  173. on mouseUp
  174.   global alarmset
  175.   set hilite of button "on" to false
  176.   set hilite of button "off" to true
  177.   set hilite of button "set" to false
  178.   hide card field "settime"
  179.   put 0 into alarmset
  180. end mouseUp
  181.  
  182.  
  183.  
  184. -- part 12 (field)
  185. -- low flags: 00
  186. -- high flags: 0004
  187. -- rect: left=88 top=72 right=89 bottom=158
  188. -- title width / last selected line: 0
  189. -- icon id / first selected line: 0 / 0
  190. -- text alignment: 1
  191. -- font id: 3
  192. -- text size: 10
  193. -- style flags: 0
  194. -- line height: 13
  195. -- part name: settime
  196. ----- HyperTalk script -----
  197. on closefield
  198.   if ((card field "settime" is not empty) and (word 2 of card field "settime" is empty)) then
  199.     if the hilite of card button "am" is true then
  200.       put " am" after card field "settime"
  201.     else
  202.       put " pm" after card field "settime"
  203.     end if
  204.   end if
  205. end closefield
  206.  
  207.  
  208.  
  209.  
  210. -- part 14 (button)
  211. -- low flags: 00
  212. -- high flags: 8006
  213. -- rect: left=116 top=95 right=111 bottom=156
  214. -- title width / last selected line: 0
  215. -- icon id / first selected line: 0 / 0
  216. -- text alignment: 1
  217. -- font id: 0
  218. -- text size: 12
  219. -- style flags: 0
  220. -- line height: 16
  221. -- part name: am
  222. ----- HyperTalk script -----
  223. on mouseUp
  224.   set hilite of card button "am" to true
  225.   set hilite of card button "pm" to false
  226. end mouseUp
  227.  
  228.  
  229.  
  230. -- part 15 (button)
  231. -- low flags: 00
  232. -- high flags: C006
  233. -- rect: left=116 top=111 right=125 bottom=157
  234. -- title width / last selected line: 0
  235. -- icon id / first selected line: 0 / 0
  236. -- text alignment: 1
  237. -- font id: 0
  238. -- text size: 12
  239. -- style flags: 0
  240. -- line height: 16
  241. -- part name: pm
  242. ----- HyperTalk script -----
  243. on mouseUp
  244.   set hilite of card button "am" to false
  245.   set hilite of card button "pm" to true
  246. end mouseUp
  247.  
  248.  
  249.  
  250. -- part contents for card part 2
  251. ----- text -----
  252. 12:11 AM
  253.  
  254. -- part contents for card part 3
  255. ----- text -----
  256. Sunday, April 24, 1988